import { configManager } from "@core/config/config.manager";
import { RedisPublisher } from "@core/redis/redis.publisher";
import { RedisSubscriber } from "@core/redis/redis.subscriber";

function createPublisher(): RedisPublisher {
  const config = configManager.getRedisConfig();
  return new RedisPublisher(config.host, config.port);
}

function createSubscriber(): RedisSubscriber {
  const config = configManager.getRedisConfig();
  return new RedisSubscriber(config.host, config.port);
}

export { createPublisher, createSubscriber };
